package com.mshop.service;

import java.util.List;

import com.mshop.fw.modules.CommonService;
import com.mshop.po.Mobile;
import com.mshop.util.QL;

public class MobileService extends CommonService {

	public List<Mobile> list(int startRows, int rows) {
		return dao.find(Mobile.class, QL.HQL.Mobile.LIST, new Object[] {},
				startRows, rows);
	}
	
	public List<Mobile> listJiang(int startRows, int rows) {
		return dao.find(Mobile.class, QL.HQL.Mobile.LIST_JIANG, new Object[] {},
				startRows, rows);
	}

	public Mobile find(String mobile) {
		return dao.findSingle(Mobile.class, QL.HQL.Mobile.FIND_BY_MOBILE,
				new Object[] { mobile });
	}

	public Long getCount() {
		return dao.getCount(QL.HQL.Mobile.GET_COUNT, null);
	}

	public void save(Mobile Mobile) {
		dao.save(Mobile);
	}

	public Mobile load(String id) {
		return dao.load(Mobile.class, new Long(id));
	}

	public Mobile get(String id) {
		return dao.get(Mobile.class, new Long(id));
	}

	public void delete(String id) {
		dao.delete(this.get(id));
	}

}
